<?php
/**
 * Created by PhpStorm.
 * User: guobao
 * Date: 2018/6/16
 * Time: 11:18
 */
namespace app\home\controller;
use menghe\core\Controller;
use menghe\model\Model;
use menghe\view\View;
use Gregwar\Captcha\CaptchaBuilder;
class Entry extends Controller {
    public function index(){
       return view();
    }
    public function add(){
        $this->setRedirect('?a=index')->message('添加成功');
    }
    public function code()
    {
        $builder = new CaptchaBuilder;
        $builder->build();
        header('Content-type: image/jpeg');
        $builder->output();
        $_SESSION['phrase'] = $builder->getPhrase();
    }
}